package org.blogwu.learn.multithread.chapter2.demo9;

public class Main2 {

    public static int value = 0;

    public static volatile boolean bb = true;

    public static void main(String[] args) throws InterruptedException {

        Thread t1 = new Thread(() -> {
            synchronized (Main2.class) {
                while (bb) {

                }
                System.out.println("程序已经结束");
            }


        });

        t1.start();
        Thread.sleep(5000);
        bb = false;
        System.out.println("over");


    }
}
